package com.server.auth.dto;

import com.server.model.all.constant.PatternConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@ApiModel
public class LoginDto {

    /***
     * 用户名
     * @author LXC
     * @date 2022/3/13 18:44
     */
    @NotBlank(message = "用户名不可为空")
    @Length(min = 2,message = "用户名长度需大于等于2")
    @Length(max = 20,message = "用户名长度需小于等于20")
    @ApiModelProperty(value = "用户名")
    private String userName;

    /**
     * 密码
     * @author LXC
     * @date 2022/3/13 18:44
     */
    @NotBlank(message = "密码不可为空")
    @Length(min = 6,message = "密码长度必须大于等于6")
    @Length(max = 20,message = "密码长度必须小于等于20")
    @Pattern(regexp = PatternConstant.CONTAIN_CAPITALIZE_LETTER,message = "密码需要包含大写字母")
    @Pattern(regexp = PatternConstant.CONTAIN_LOW_LETTER,message = "密码需要包含小写字母")
    @Pattern(regexp = PatternConstant.CONTAIN_NUMBER,message = "密码需要包含数字")
    @ApiModelProperty(value = "密码")
    private String passWord;

    /**
     * 验证码Key
     * @author LXC
     * @date 2022/9/11 14:15
     */
    @NotBlank(message = "验证码不可为空")
    @ApiModelProperty(value = "验证码Key")
    private String textCode;


    /**
     * 验证码
     * @author LXC
     * @date 2022/9/11 14:15
     */
    @NotBlank(message = "验证码不可为空")
    @Length(min = 4,max = 4,message = "验证码长度必须等于4")
    @ApiModelProperty(value = "验证码")
    private String textValue;

}
